GtkSwitch: End animation in set_active
authorMatthias Clasen <mclasen@redhat.com>
Mon, 4 Aug 2014 12:21:59 +0000 (14:21 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 4 Aug 2014 12:36:42 +0000 (14:36 +0200)
End any running toggle animation before setting the set,
otherwise things get confused.

gtk/gtkswitch.c

index 915dc3899fb4e23e467611fde871001504f63c4b..534dc5834ad7f7fcd3f9530ab652d00313430d76 100644 (file)
@@ -160,7 +160,6 @@ gtk_switch_on_frame_clock_update (GdkFrameClock *clock,
     }
   else
     {
-      gtk_switch_end_toggle_animation (sw);
       gtk_switch_set_active (sw, !priv->is_active);
       priv->handle_x = priv->dest_offset;
     }
@@ -1075,6 +1074,8 @@ gtk_switch_set_active (GtkSwitch *sw,
 
   g_return_if_fail (GTK_IS_SWITCH (sw));
 
+  gtk_switch_end_toggle_animation (sw);
+
   is_active = !!is_active;
 
   priv = sw->priv;